package netctoss.demo.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import netctoss.demo.entrty.Account;
import netctoss.demo.mapper.AccountMapper;
import netctoss.demo.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class AccountServiceImpl extends BaseServiceImpl<Account> implements AccountService {


    @Autowired
    AccountMapper accountMapper;
    @Override
    public PageInfo<Account> selectPage(Integer pageNum,Integer pageSize,Account account){
        PageHelper.startPage(pageNum,pageSize);
        List<Account> accounts = accountMapper.selectPage(account);
        return  new PageInfo<>(accounts);

    }

    @Override
    public Account selectByAid(Long aid) {
        return accountMapper.selectByAid(aid);
    }
}
